package shake.context;

import java.util.Map;

import shake.annotation.Component;
import shake.util.ApplicationMap;
import shake.util.RequestMap;
import shake.util.SessionMap;

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;

@Component(type = Contexts.class)
@Singleton
public class ServletContexts extends Contexts {

	@Inject
	ApplicationMap map;

	@Inject
	Provider<PageContext> page;

	@Inject
	Provider<RedirectContext> redirect;

	@Inject
	Provider<SessionMap> session;

	@Inject
	Provider<RequestMap> request;

	@Override
	public Map<String, Object> getApplication() {
		return map;
	}

	@Override
	public Map<String, Object> getPage() {
		return page.get().getMap();
	}

	@Override
	public Map<String, Object> getRediect() {
		return redirect.get().getMap();
	}

	@Override
	public Map<String, Object> getRequest() {
		return request.get();
	}

	@Override
	public Map<String, Object> getSession() {
		return session.get();
	}

}
